package cn.itsource.ymcc.web.controller;

import cn.itsource.ymcc.result.JSONResult;
import cn.itsource.ymcc.service.ITokenService;
import com.sun.org.apache.bcel.internal.generic.RETURN;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author Eric Chen
 * @since 2022/7/22
 */
@RestController
public class TokenController {

    @Autowired
    private ITokenService tokenService ;

    //创建一个Token
    @GetMapping("/createToken/{courseId}")
    public JSONResult createToken(@PathVariable("courseId")String courseId){ //9,1
        String token = tokenService.createToken(courseId);
        return JSONResult.success(token);
    }
}
